home *** CD-ROM | disk | FTP | other *** search
- # Jedi Knight Cog Script
- #
- # 00_SECURITYCAM.COG
- #
- # Security camera cog.
- #
- # [YB]
- #
- # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
-
-
- symbols
-
- thing camera
-
- int player local
- int triggerNum=10001 local
- int active=1 local
- vector cameraPos local
-
-
- message startup
- message killed
- message pulse
-
- end
-
- # ========================================================================================
-
- code
-
- startup:
- player = GetLocalPlayerThing();
- cameraPos = GetThingPos(camera);
-
- SetPulse(1.0);
-
- Return;
-
- # ........................................................................................
-
- killed:
- SetPulse(0.0);
- active = 0;
-
- Return;
-
- # ........................................................................................
-
- pulse:
- if(!active) Return;
-
- if(FirstThingInView(camera, 60, 5.0, 0x400) != -1)
- {
- // Send a TRIGGER_SECURITY with its parameters (the camera who saw him)
- if(VectorDist(cameraPos, GetThingPos(player)) < 2.0)
- SendTrigger(-1, triggerNum, camera, 0, 0, 0);
- }
-
- Return;
-
- end
-
-
-